#include "org/rule.h"
#include "treewidgetitem_node.h"
#include <vector>
#include "org/discoginfo.h"

using namespace Org;
using namespace std;

#ifndef FRMRULE_H
#define FRMRULE_H

#include <QtGui/QDialog>
#include <QAbstractButton>
#include <QTreeWidgetItem>

#include <iostream>
#include "ui_frmrule.h"
//#include "org/vars.h"
#include "org/organiser.h"


using namespace Org;

namespace Ui {
    class frmRule;
}

class frmRule : public QDialog {
    Q_OBJECT
public:
    frmRule(QWidget *parent = 0);    
    frmRule(Org::Rule*, QWidget *parent = 0);
    ~frmRule();     
     static size_t cb_parse_discogs_response(void *buffer, size_t size, size_t nmemb, void *userp);

public slots:
    void btnBrowseToDir_clicked();
    void btnCommandsSave_clicked();
    void btnCommandsCancel_clicked();
    void treeConditions_item_changed();
    void btnGetDiscogs_clicked();



protected:
    void changeEvent(QEvent *e);

private:
    Ui::frmRule *m_ui;
    Org::Rule *rule;
    void setupForm();
    void populateTreeConditions(const vector<Node>, TreeWidgetItem_Node*);

    void fillRuleDetails();
};

#endif // FRMRULE_H
